package leecode.stringAndArray.doublepoint;

public class TwoSum {
    public static void main(String[] args) {

    }

    public static int[] twoSum(int[] numbers, int target) {
        int i=0,j=numbers.length-1;
        while (true){
            if(numbers[i]+numbers[j]<target){
                i++;
            }else if(numbers[i]+numbers[j]>target){
                j--;
            }else {
                return new int[]{i+1,j+1};
            }
        }
    }
}
